#include <iostream>
#include <string>

// 定义一个表示图书信息的结构体
struct Book {
    std::string title;
    std::string author;
    int year;
};

int main() {
    // 定义一个包含 3 本图书信息的结构体数组
    Book books[3] = {
        {"C++ Primer", "Stanley Lippman", 2012},
        {"Effective C++", "Scott Meyers", 2005},
        {"The C Programming Language", "Brian Kernighan", 1978}
    };

    // 遍历结构体数组并输出每本图书的信息
    for (int i = 0; i < 3; ++i) {
        std::cout << "Book " << i + 1 << ":" << std::endl;
        std::cout << "Title: " << books[i].title << std::endl;
        std::cout << "Author: " << books[i].author << std::endl;
        std::cout << "Year: " << books[i].year << std::endl;
        std::cout << std::endl;
    }

    return 0;
}
